import '@/assets/styles/index.scss'
import 'element-plus/dist/index.css'

import App from './App.vue'
import router from '@/router'

// 注册指令
import plugins from './plugins' // plugins
import locale from 'element-plus/es/locale/lang/zh-cn'
import ElementPlus from 'element-plus'
// 分页组件
import Pagination from './components/Pagination/index.vue'
// 自定义表格工具组件
import RightToolbar from './components/RightToolbar/index.vue'
// 图片上传组件
import ImageUpload from "./components/ImageUpload/index.vue"
// 图片预览组件
import ImagePreview from "./components/ImagePreview/index.vue"

import { createApp } from 'vue'
import { parseTime, resetForm, addDateRange } from '@/utils/zaizai'

const app = createApp(App)

// 全局组件挂载
app.component('Pagination', Pagination)
app.component('RightToolbar', RightToolbar)
app.component('ImageUpload', ImageUpload)
app.component('ImagePreview', ImagePreview)

// 全局方法挂载
app.config.globalProperties.parseTime = parseTime
app.config.globalProperties.resetForm = resetForm
app.config.globalProperties.addDateRange = addDateRange

app.use(router)
app.use(plugins)

// 使用element-plus 并且设置全局的语言
app.use(ElementPlus, {
    locale: locale
})

app.mount('#app')
